import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '预算批次',
    align:"center",
    dataIndex: 'budId'
   },
   {
    title: '上级ID',
    align:"center",
    dataIndex: 'superCompensateItemId'
   },
   {
    title: '上级名称',
    align:"center",
    dataIndex: 'superCompensateItemName'
   },
   {
    title: '本级ID',
    align:"center",
    dataIndex: 'compensateItemId'
   },
   {
    title: '付款项',
    align:"center",
    dataIndex: 'compensateItemName'
   },
   {
    title: '单位',
    align:"center",
    dataIndex: 'unit'
   },
   {
    title: '单价',
    align:"center",
    dataIndex: 'unitPrice'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'ordernum'
   },
   {
    title: '单位',
    align:"center",
    dataIndex: 'unitName'
   },
   {
    title: 'superCompensateItemCode',
    align:"center",
    dataIndex: 'superCompensateItemCode'
   },
   {
    title: 'compensateItemCode',
    align:"center",
    dataIndex: 'compensateItemCode'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '预算批次',
    field: 'budId',
    component: 'Input',
  },
  {
    label: '上级ID',
    field: 'superCompensateItemId',
    component: 'Input',
  },
  {
    label: '上级名称',
    field: 'superCompensateItemName',
    component: 'Input',
  },
  {
    label: '本级ID',
    field: 'compensateItemId',
    component: 'Input',
  },
  {
    label: '付款项',
    field: 'compensateItemName',
    component: 'Input',
  },
  {
    label: '单位',
    field: 'unit',
    component: 'Input',
  },
  {
    label: '单价',
    field: 'unitPrice',
    component: 'InputNumber',
  },
  {
    label: '排序',
    field: 'ordernum',
    component: 'InputNumber',
  },
  {
    label: '单位',
    field: 'unitName',
    component: 'Input',
  },
  {
    label: 'superCompensateItemCode',
    field: 'superCompensateItemCode',
    component: 'Input',
  },
  {
    label: 'compensateItemCode',
    field: 'compensateItemCode',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  budId: {title: '预算批次',order: 0,view: 'text', type: 'string',},
  superCompensateItemId: {title: '上级ID',order: 1,view: 'text', type: 'string',},
  superCompensateItemName: {title: '上级名称',order: 2,view: 'text', type: 'string',},
  compensateItemId: {title: '本级ID',order: 3,view: 'text', type: 'string',},
  compensateItemName: {title: '付款项',order: 4,view: 'text', type: 'string',},
  unit: {title: '单位',order: 5,view: 'text', type: 'string',},
  unitPrice: {title: '单价',order: 6,view: 'number', type: 'number',},
  ordernum: {title: '排序',order: 7,view: 'number', type: 'number',},
  unitName: {title: '单位',order: 8,view: 'text', type: 'string',},
  superCompensateItemCode: {title: 'superCompensateItemCode',order: 9,view: 'text', type: 'string',},
  compensateItemCode: {title: 'compensateItemCode',order: 10,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}